<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>

<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>添加神秘访客评分单</title>
<style type="text/css">
body{
	margin:10px;  
	font-size:0.9em;
}
a{
	color:#F00;
}
.STYLE1 {color: #FF0000}
</style>
<!-- extjs -->
<link rel="stylesheet" type="text/css" href="sys/extjs/css/ext-all.css">
<script type="text/javascript" src="sys/extjs/js/ext-base.js"></script>
<script type="text/javascript" src="sys/extjs/js/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="sys/extjs/css/tables-example.css">	
<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="sys/style01/css/tab-view.css" type="text/css" media="screen">
<link href="sys/style01/date/css/banzu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="sys/style01/date/include/js/calendar.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/checkdate.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/calendar-zh.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/calendar-setup.js"></script>
</head>
<SCRIPT src="sys/js/include/Calendar2.js"></SCRIPT>
<script type="text/javascript"> 
function checkFloat(String) { 
	var Letters = "1234567890."; 
	var i; 
	var c; 
	if(String.charAt(0) == '.'){
		return false;
	}
	for( i = 0; i < String.length; i ++ ){ 
		c = String.charAt( i ); 
		if (Letters.indexOf( c ) ==-1){ 
			return false; 
		} 
	} 
	var arrScore = String.split(".");
	if(arrScore.length > 2){
		return false;
	}
return true; 
}  

	function save(){
		if(document.form1.visitor_area.value==""){
			alert("请选择区域");
			return;
		}
		if(document.form1.shop_id.value==""){
			alert("请选择商店");
			return;
		}
		if(document.form1.v_oversee.value==""){
			alert("请选择督导");
			return;
		}
		if(document.form1.v_date.value==""){
			alert("请选择年月");
			return;
		}
		if(document.form1.v_province.value==""){
			alert("请填写省份");
			return;
		}
		if(document.form1.v_city.value==""){
			alert("请填写城市");
			return;
		}
		if(document.form1.v_city_level.value==""){
			alert("请填写城市级别");
			return;
		}
		if(document.form1.v_dealer_name.value==""){
			alert("请填经销商");
			return;
		}
		if(document.form1.v_shop_name.value==""){
			alert("请填写店面名称");
			return;
		}
		if(document.form1.v_shop_address.value==""){
			alert("请填写店面地址");
			return;
		}
		if(document.form1.v_position_code.value==""){
			alert("请填写位置编码");
			return;
		}
		if(document.form1.v_acershop_level.value==""){
			alert("请填写Acer店面等级");
			return;
		}
		if(document.form1.v_shop_sort.value==""){
			alert("请填写商店类别");
			return;
		}
		if(checkFloat(document.form1.v_sum_grade.value) == false){
			alert("店面总成绩格式错误");
			return;
		}
		document.form1.submit();
    }

    function selectEmer(value) {
    	if(value == "6"){
			document.getElementById("qita1").style.display = "";
			document.getElementById("qita2").style.display = "";
		}else{
			document.getElementById("qita1").style.display = "none";
			document.getElementById("qita2").style.display = "none";
		}
    }

</script>
<body class="ridgeBody">
<table align="center" width="100%"><tr><td align="center">
<form name="form1" method="post" action="hr/insertVisitorScore.action"  >
	<table class=datatable width="100%" cellpadding='0' cellspacing='0' border='1' bordercolordark='white' bordercolorlight='#BEBEBE'>
	    <tr>
	        <td height="25" colspan="4" valign="top" class="dataTitle"><br>神秘访客评分</td>
	    </tr>	     
      <tr>        
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>区域：</td>
        <td height="22" >
        <input name="area_id"  type="hidden" class="input" readonly /> 
        	<input name="visitor_area"  type="text" class="input" readonly /> 
        	<span style="color:red;cursor:hand;textDecoration:underline" onclick="window.open('<%=request.getContextPath() %>/hr/areaListPopup.action')">查询</span> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>SHOP ID：</td>
        <td height="22" >
        	<input name="v_shop_name"  type="hidden" class="input" readonly /> 
       		 <input name="shop_id"  type="text" class="input" readonly /> 
        	<span style="color:red;cursor:hand;textDecoration:underline" onclick="window.open('<%=request.getContextPath() %>/hr/v_shopListPop.action')">查询</span> 
        </td>
      </tr> 
     <tr>
     <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>督导：</td>
      <td height="22" >
        <input name="ctm_code"  type="hidden" class="input" readonly /> 
        	<input name="v_oversee"  type="text" class="input" maxlength="70" readonly /> 
        	<span style="color:red;cursor:hand;textDecoration:underline" onclick="window.open('<%=request.getContextPath() %>/hr/vistorCtmListPop.action')">查询</span> 
        </td>
     <td width="25%" height="22" valign="top" nowrap class="datatr1"><font color="#FF0000">*</font>年月：</td>
					<td valign="top" nowrap class="tabimputright">       
						<input name="v_date" type="text" class="input" onclick="setday(this)"  value="" readOnly/>
	    			</td>
     </tr>
     <tr>
     <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>省份：</td>
        <td height="22" >
        	<input name="v_province"  type="text" class="input"  /> 
        </td>
		<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>城市：</td>
        <td height="22" >
        	<input name="v_city"  type="text" class="input"  /> 
        </td>
     </tr>
     <tr>
	 	<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>城市级别：</td>
        <td height="22" >
        	<input name="v_city_level"  type="text" class="input"  /> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>经销商名称：</td>
        <td height="22" >
        	<input name="v_dealer_name"  type="text" class="input"  /> 
        </td>
     </tr>
     <tr>
	 	<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>店面名称：</td>
        <td height="22" >
        	<input name="v_shop_name"  type="text" class="input"  /> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>店面地址：</td>
        <td height="22" >
        	<input name="v_shop_address"  type="text" class="input"  /> 
        </td>
     </tr>
     <tr>
	 	<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>位置编码：</td>
        <td height="22" >
        	<input name="v_position_code"  type="text" class="input"  /> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>Acer店面等级：</td>
        <td height="22" >
        	<input name="v_acershop_level"  type="text" class="input"  /> 
        </td>
     </tr>
     <tr>
	 	<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>品类店/专卖店：</td>
        <td height="22" >
        	<input name="v_shop_sort"  type="text" class="input"  /> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>突发事件：</td>
        <td height="22" >
        	<select id="emergency" name="v_emergency" size="1" onchange="selectEmer(this.value);">
    	    	<option value="0" selected>没有 
	     		<option value="1">装修 
	     		<option value="2">撤店
	     		<option value="3">物理地址错误
	     		<option value="4">未营业
	     		<option value="5">拒访
	     		<option value="6">其他
        	</select> 
        </td>
     </tr>
     <tr>
     	<td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>店面总得分：</td>
        <td height="22" >
        	<input name="v_sum_grade"  type="text" class="input"  /> 
        </td>
        <td height="22" nowrap="nowrap" class="datatr1"><div  id="qita1" style="display: none"><span class="STYLE1" >*</span>请说明其他：</div></td>
        <td height="22" >
        	<div  id="qita2" style="display: none"><input id="qita_value" name="qita_value"  type="text"  /></div>
        </td>
     </tr>
</table>

<table width="100%" bgcolor="#96BDDA">
<tr>
<td height="20" colspan="6" valign="top" class="dataTitle">
<input type="button"  onClick="save()" value="保存">
<input type="reset"  onClick="" value="重置"></td>
</tr> 
</table>
<input type="hidden" name="flag">
</form>
</td></tr></table>
</body>
</html> 

